<div>
    <input class="input-block-level" type="hidden" value="<?=$this->model->getBuyId()?>" name="buy-id" id="buy-id">
    <label for="term-title">Заголовок:</label>
    <input class="input-block-level" type="text" value="<?=$this->model->getBuyName()?>" placeholder="Заголовок" name="buy-title" id="buy-title">
    <div class="buy-types">
        <h6><i class="icon-tasks"></i>Тип:</h6>
        <select id="buy-type" name="buy-type">
            <? $types = Application_Model_Buy::getTypes(); foreach ($types as $typeId => $type) :?>
            <option value="<?=$typeId?>" <?if ($this->model->getBuyType() == $typeId):?>selected="selected"<? endif; ?>><?= $type ?></option>
            <? endforeach;?>
        </select>
    </div>
    <label for="buy-desc">Описание:</label>
    <textarea id="buy-desc" style="height:200px;" name="buy-desc"><?=$this->model->getBuyDescription()?></textarea>
    <div class="form-actions">
        <button type="submit" class="btn btn-primary" onclick="buy.save()">Сохранить</button>
        <button type="button" class="btn" onclick="<?if (!$this->isAddMode):?> modal.close(); <? else: ?>buy.deleteBuyForm(<?=$this->model->getBuyId()?>); <? endif; ?>">Отмена</button>
    </div>
</div>
<script type="text/javascript">
    (function(){
        $('#buy-desc').redactor();
    }());
</script>